[SUBROUTINE]
version = 1.14
icon = slot.png
name = _("Slot/oval 1 point")
type = slot
help = _("<b>Creates a Slot from a single point</b>&#10;Reference point can be center of slot or of one end")
order = act pv h1 x ref y h5 w l rot h2 opt xa dir s u_s ugc dpt u_dpt ugcd h4 fp fcs

[PARAM_ACT]
name = _("Active")
icon = enable.png
type = bool
value = 1

[PARAM_PV]
name = _("Show design")
icon = glasses.png
type = bool
value = 1

[PARAM_H1]
name = _("Coords")
type = sub-header

[PARAM_H5]
name = _("Size, rotation")
type = sub-header

[PARAM_REF]
name = _("X axis align")
icon = ref-slot-ctr.png
header = h1
type = combo
options = _("End=0:Center of slot=1")
tool_tip = _("X,Y center of slot or left end")
value = 0

[PARAM_X]
name = _("X")
header = h1
type = float
icon = x.png
tool_tip = _("X Center")
value = 0
metric_value = 0.0

[PARAM_Y]
name = _("Y")
header = h1
type = float
icon = y.png
tool_tip = _("Y center")
value = 0
metric_value = 0.0

[PARAM_W]
name = _("Width")
header = h5
type = float
icon = oval-d.png
tool_tip = _("Width of slot")
value = 0.5
metric_value = 12
minimum_value = 0
not_allowed = 0

[PARAM_L]
name = _("Effective length")
header = h5
type = float
icon = oval-w.png
tool_tip = _("Length between center of arcs")
value = 1
metric_value = 25
minimum_value = 0
not_allowed = 0

[PARAM_ROT]
name = _("Rotation")
header = h5
type = float
digits = 2
icon = angle.png
tool_tip = _("Angle rotated")
value = 0
suffix = &#176;

[PARAM_H2]
name = _("Milling")
type = sub-header

[PARAM_OPT]
name = _("Option")
header = h2
type = combo
options = _("Inside normal=0:Pocket=1:On the line=2:Outside=3")
icon = g4x.png
tool_tip = _("Select tool path")
value = 0

[PARAM_XA]
name = _("Arc lead-out")
type = bool
icon = lead-out.png
tool_tip = _("Not if on the line")
value = 1
header = h2

[PARAM_DIR]
name = _("Direction")
header = h2
type = combo
options = _("Clockwise=2:Counter-Clockwise=3")
icon = cw-ccw.png
tool_tip = _("Direction of tool path")
value = 3

[PARAM_S]
name = _("Cut start")
type = combo-user
options = _("User defined=0:Surface=1:Half=2:One quarter=3:Three quarter=4:G-Code=5")
icon = surface.png
tool_tip = _("Pre or user defined")
value = 1
header = h2
links = u_s=0:ugc=5

[PARAM_U_S]
name = _("User start")
type = float
value = 0.0
metric_value = 0.0
header = h2
hidden = 1

[PARAM_UGC]
name = User gcode
type = gcode
value = 
header = h2
hidden = 1

[PARAM_UGCD]
name = User depth gcode
type = gcode
value =
header = h2
hidden = 1

[PARAM_DPT]
name = _("Cut down to")
type = combo-user
options = _("User defined=0:Through=1:Bottom=2:Half=3:One quarter=4:Three quarter=5:G-Code=6")
icon = depth.png
tool_tip = _("Pre or user defined")
value = 1
header = h2
links = u_dpt=0:ugcd=6

[PARAM_U_DPT]
name = _("User depth")
type = float
value = -0.5
metric_value = -12.0
header = h2
hidden = 1

[PARAM_H4]
name = _("Finishing")
type = sub-header

[PARAM_FP]
name = _("Finishing pass")
type = combo
options = _("None=0:Clockwise=2:Clockwise full depth=12:Counter-Clockwise=3:Counter-Clockwise full depth=13")
tool_tip = _("Conventional for better finish")
value = 0
header = h4
icon = finish.png

[PARAM_FCS]
name = _("Finishing cut")
header = h4
type = float
minimum_value = 0.01
icon = rect-pocket.png
tool_tip = _("Last finishing cut")
value = 0.04
metric_value = 1.0

[DEFINITIONS]
content =
;	<eval>self.include_once(file name here)</eval>

[CALL]
content =
	(begin #sub_name)
	(slot from center or end author: Fernand Veilleux)
	
	o<#self_id_active> if [#param_act] (if active)
		#<l#ID>   = [#param_l]
		#<w#ID>   = [#param_w]
		#<fcs#ID> = [#param_fcs]
		
		o<select> CALL [31] [#param_s] [#param_u_s] [#<surface>] [#<surface> - #<wp_depth> / 2] [#<surface> - #<wp_depth> / 4] [#<bottom> + #<wp_depth> / 4] [#param_ugc]
		o<select> CALL [32] [#param_dpt] [#param_u_dpt] [#<bottom_through>] [#<bottom>] [#<surface> - #<wp_depth> / 2] [#<surface> - #<wp_depth> / 4] [#<bottom> + #<wp_depth> / 4] [#param_ugcd]
		
		o<select> CALL [33] [#param_ref] [#<l#ID> / 2] [0]
		
		o<rectangle> CALL [#param_x] [#param_y] [#<l#ID> + #<w#ID>] [#<w#ID>] [#param_rot] [#33] [0] [1] [#<w#ID> / 2] [#param_opt] [#param_dir] [#31] [#32] [#param_pv] [#param_fp] [#<fcs#ID>] [#param_xa]
		
	o<#self_id_active> endif
	(end #sub_name)
